package com.sskj.gcc.ui.activity;


import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.gcc.bean.SellRecords;
import com.sskj.gcc.presenter.BasePresenter;
import com.sskj.gocoin.MyAppLication;
import com.sskj.gocoin.m.HttpConfig;
import com.sskj.gocoin.m.bean.WithdrawListBean;
import com.sskj.lib.bean.PageBean;
import com.sskj.lib.http.JsonCallBack;

import java.util.List;

/**
 * @author Hey
 * Create at  2019/07/30 16:06:36
 */
class SellRecordsPresenter extends BasePresenter<SellRecordsActivity> {


    public void getSellRecords(int page) {
        OkGo.<HttpData<PageBean<SellRecords>>>post(HttpConfig.BASE_URL + HttpConfig.SELL_RECORDS)
                .params("p",page)
                .params("size",10)
                .execute(new JsonCallBack<HttpData<PageBean<SellRecords>>>() {
                    @Override
                    public void onSuccess(Response<HttpData<PageBean<SellRecords>>> response) {
                        mView.setData(response.body().getData().getList());

                    }

                    @Override
                    public void onFinish() {
                        super.onFinish();
                        mView.stopRefresh();
                    }
                });
    }

}
